#!/bin/bash
printf "=======================执行java springboot=================\n"
java_home="/opt/tools/jdk1.8.0_221"
pro_home="/opt/pro"
env=${active}
pro=${proName}
echo "对应spring boot 服务" $pro
if [ ! $env ]; then
        env='local'
else
        env=${active}
fi
echo "环境变量" $env
#server1=$(ps -ef|grep "epc-base"|grep -v grep|awk '{print $2}')
server1=$(ps -ef|grep $pro|grep 'java'|grep -v grep| awk '{print $2}')
printf "服务id:   $server1"
if [ $server1 ]; then
        `kill -9 $server1`
        printf "=============kill restart\n"
        sleep 5
fi
        printf "===========start\n"
printf "$java_home/bin/java -jar -Dfile.encoding=UTF-8 -Dspring.profiles.active=$env $pro_home/$pro.jar  >$pro_home/logs/$pro.out \n"
out=`$java_home/bin/java -jar -Dfile.encoding=UTF-8 -Dspring.profiles.active=$env $pro_home/$pro.jar > $pro_home/logs/$pro.out`
printf "启动完毕========"

